package lambda;

import java.util.Arrays;
import java.util.List;
import java.util.function.Consumer;

interface Calculator<T> {
	T calculate(T t1, T t2);
}

public class LambdaDemo2 {
	public static void main(String[] args) {

		Calculator<Integer> c1 = (t1, t2) -> t1 - t2;
		Calculator<Integer> c2 = (t1, t2) -> t1 + t2;
		Calculator<Integer> c3 = (t1, t2) -> t1 * t2;
		Calculator<Integer> c4 = (t1, t2) -> t1 / t2;

		System.out.println(c1.calculate(1, 2));
		System.out.println(c2.calculate(1, 2));
		System.out.println(c3.calculate(1, 2));
		System.out.println(c4.calculate(1, 2));
		
		List<String> list = Arrays.asList("abc","www","ttt","yyy","o2qiur");
		list.forEach((t)-> System.out.println(t));
		
	}
}
